<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
include("../inc/conn.inc");
$url=$_SERVER['HTTP_REFERER'];
if($_COOKIE[user_id]){
$rs=@mysql_query("select * from buy where id='".$_GET['id']."'");
$row=@mysql_fetch_array($rs);
@mysql_query("insert into basket (member_id,b_title,b_url,b_addtime) values ('".$_COOKIE['user_id']."','$row[b_title]','".$url."','".date("Y-m-d H:i:s")."')");
echo "<script>alert('收藏成功');location='".$url."';</script>";
}else{
echo "<script>location='/login';</script>";
}
?>